#!/usr/bin/env python
# -*- coding:utf-8 -*-
import socket
import sys
from sys import argv


def exec_cmd():
    if len(argv) < 2:
        print("argv's len is less 1.", argv)
        sys.exit("args error")

    sk_obj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        sk_obj.connect(('svn_server', 12000))
    except socket.error:
        print('fail to setup socket_test connection')
    sk_obj.send(str.encode("Tmn3Qgd>3S"))  # token
    sk_obj.send(str.encode(argv[1]))
    data = sk_obj.recv(1024)
    print('Server send information : %s' % data.decode('utf-8'))


if __name__ == '__main__':
    exec_cmd()
